package com.yilin.tms.core.entity.system.handle;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.entity.user.UserType;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 用户投诉表
 *
 * @author zhangjinyuan
 * @date 2022/7/6
 */
@Entity
@Table(name = "sys_complaint")
@TableName("sys_complaint")
public class Complaint extends BaseDataEntity {
    //投诉状态
    public enum ComplaintState {
        waiting(0, "等待处理"),
        complete(1, "完成");
        @EnumValue
        public Integer index;
        public String name;

        ComplaintState(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    //投诉类型
    public enum ComplaintType {
        organize(0, "组织"),//管理员
        vehicle(1, "车源"),//车主
        goodsOrder(2, "货源"),//货主
        robOrder(3, "抢单"),//货主或车主
        transitOrder(4, "运单");//货主或司机
        @EnumValue
        public Integer index;
        public String name;

        ComplaintType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    //处理结果
    public enum ComplaintResult {
        warning(0, "警告"),
        deduction(1, "扣分"),
        disable(2, "停用"),
        none(3, "不处理");
        @EnumValue
        public Integer index;
        public String name;

        ComplaintResult(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    /**
     * 基本信息
     */
    //标题
    @Column(name = "title")
    private String title;
    //投诉类型
    @Column(name = "complaint_type")
    private ComplaintType complaintType;
    //投诉订单Id 根据投诉类型可能是车源id、货源id等
    @Column(name = "complaint_source_id")
    private String complaintSourceId;
    //投诉状态
    @Column(name = "complaint_state")
    private ComplaintState complaintState;
    //投诉原因
    @Column(name = "content")
    private String content;
    //图片
    @Column(name = "img_url", columnDefinition = "TEXT")
    private String imgUrl;
    /**
     * 投诉发起人信息
     */
    //投诉人Id
    @Column(name = "from_account_id")
    private String fromAccountId;
    //投诉人名称
    @Column(name = "from_account_name")
    private String fromAccountName;
    //投诉人电话
    @Column(name = "from_account_phone")
    private String fromAccountPhone;
    /**
     * 被投诉组织信息
     */
    //被投诉人
    @Column(name = "be_account_id")
    private String beAccountId;
    //被投诉人名称
    @Column(name = "be_account_name")
    private String beAccountName;
    //被投诉组织Id
    @Column(name = "be_organize_id")
    private String beOrganizeId;
    //被投诉组织名称
    @Column(name = "be_organize_name")
    private String beOrganizeName;
    //被投诉组织名称
    @Column(name = "be_user_type")
    private UserType beUserType;
    //被投诉组织名称
    @Column(name = "be_manager_user_phone")
    private String beManagerUserPhone;
    /**
     * 处理结果
     */
    //处理时间
    @Column(name = "deal_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date dealTime;
    //处理人Id
    @Column(name = "deal_account_id")
    private String dealAccountId;
    //处理人名称
    @Column(name = "deal_account_name")
    private String dealAccountName;
    //处理结果
    @Column(name = "deal_result")
    private ComplaintResult dealResult;
    //扣除分数 处理结果为扣分时必须
    @Column(name = "deduct_score")
    private Double deductScore = 0d;
    //处理原因
    @Column(name = "deal_content")
    private String dealContent;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ComplaintType getComplaintType() {
        return complaintType;
    }

    public void setComplaintType(ComplaintType complaintType) {
        this.complaintType = complaintType;
    }

    public String getComplaintSourceId() {
        return complaintSourceId;
    }

    public void setComplaintSourceId(String complaintSourceId) {
        this.complaintSourceId = complaintSourceId;
    }

    public ComplaintState getComplaintState() {
        return complaintState;
    }

    public void setComplaintState(ComplaintState complaintState) {
        this.complaintState = complaintState;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getFromAccountId() {
        return fromAccountId;
    }

    public void setFromAccountId(String fromAccountId) {
        this.fromAccountId = fromAccountId;
    }

    public String getFromAccountName() {
        return fromAccountName;
    }

    public void setFromAccountName(String fromAccountName) {
        this.fromAccountName = fromAccountName;
    }

    public String getFromAccountPhone() {
        return fromAccountPhone;
    }

    public void setFromAccountPhone(String fromAccountPhone) {
        this.fromAccountPhone = fromAccountPhone;
    }

    public String getBeAccountId() {
        return beAccountId;
    }

    public void setBeAccountId(String beAccountId) {
        this.beAccountId = beAccountId;
    }

    public String getBeAccountName() {
        return beAccountName;
    }

    public void setBeAccountName(String beAccountName) {
        this.beAccountName = beAccountName;
    }

    public String getBeOrganizeId() {
        return beOrganizeId;
    }

    public void setBeOrganizeId(String beOrganizeId) {
        this.beOrganizeId = beOrganizeId;
    }

    public String getBeOrganizeName() {
        return beOrganizeName;
    }

    public void setBeOrganizeName(String beOrganizeName) {
        this.beOrganizeName = beOrganizeName;
    }

    public UserType getBeUserType() {
        return beUserType;
    }

    public void setBeUserType(UserType beUserType) {
        this.beUserType = beUserType;
    }

    public String getBeManagerUserPhone() {
        return beManagerUserPhone;
    }

    public void setBeManagerUserPhone(String beManagerUserPhone) {
        this.beManagerUserPhone = beManagerUserPhone;
    }

    public Date getDealTime() {
        return dealTime;
    }

    public void setDealTime(Date dealTime) {
        this.dealTime = dealTime;
    }

    public String getDealAccountId() {
        return dealAccountId;
    }

    public void setDealAccountId(String dealAccountId) {
        this.dealAccountId = dealAccountId;
    }

    public String getDealAccountName() {
        return dealAccountName;
    }

    public void setDealAccountName(String dealAccountName) {
        this.dealAccountName = dealAccountName;
    }

    public ComplaintResult getDealResult() {
        return dealResult;
    }

    public void setDealResult(ComplaintResult dealResult) {
        this.dealResult = dealResult;
    }

    public Double getDeductScore() {
        return deductScore;
    }

    public void setDeductScore(Double deductScore) {
        this.deductScore = deductScore;
    }

    public String getDealContent() {
        return dealContent;
    }

    public void setDealContent(String dealContent) {
        this.dealContent = dealContent;
    }
}
